package com.hyh.spring.service.impl;

import com.hyh.spring.dao.StorageDao;
import com.hyh.spring.service.StorageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @BelongsPackage: com.hyh.spring.service.impl
 * @ClassName StorageServiceImpl
 * @Author: hyhWTX
 * @CreateTime: 2023-06-06  12:19
 * @Description: TODO (一句话描述以下该类的功能)
 * @Version: 1.0
 */
@Service
public class StorageServiceImpl implements StorageService {

    private static final Logger LOGGER = LoggerFactory.getLogger(StorageServiceImpl.class);

    @Resource
    private StorageDao storageDao;

    /**
     * 扣减库存
     */
    @Override
    public void decrease(Long productId, Integer count) {
        LOGGER.info("------->storage-service中扣减库存开始");
        storageDao.decrease(productId,count);
        LOGGER.info("------->storage-service中扣减库存结束");
    }

}
